

/**
 * @author Carlos
 * @version 1.0
 * @created 09-oct-2013 05:23:43 p.m.
 */
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace GameEngine.animations
{
    public class Animation
    {
        #region Attributes
        public int framesX { get; set; }
        public int framesY { get; set; }
        public int totalFrames { get; set; }
        public Texture2D texture { get; set; }
        public PostProcessEffect postProcessEffect { get; set; } 
        #endregion

        #region Constructors
        public Animation(Texture2D texture, int framesX, int framesY, int totalFrames, PostProcessEffect postProcessEffect)
        {
            this.texture = texture;
            this.framesX = framesX;
            this.framesY = framesY;
            this.totalFrames = totalFrames;
            this.postProcessEffect = postProcessEffect;
        }
        public Animation(Texture2D texture, int framesX, int framesY, int totalFrames) :
            this(texture, framesX, framesY, totalFrames, null) { }
        public Animation(Texture2D texture): 
            this(texture,1,1,1){ }
        #endregion

        #region Functionality
        public Vector2 getFrameSize()
        {
            return new Vector2((int)(texture.Width / framesX), (int)(texture.Height / framesY));
        }
        
        #endregion

        public override string ToString()
        {
            string ans = "";
            ans += "framesX: " + framesX + "\n";
            ans += "framesY: " + framesY + "\n";
            ans += "totalFrames: " + totalFrames + "\n";
            ans += "Texture2D: " + texture.Name + "\n";
            return ans;
        }
    }
}